package cn.chiship.framework.upms.biz.system.pojo.dto;

import cn.chiship.framework.common.constants.TipConstants;
import cn.chiship.sdk.core.base.constants.RegularExpressionConstants;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.hibernate.validator.constraints.Length;
import cn.chiship.framework.upms.biz.system.entity.UpmsQuartzJobLog;

import javax.validation.constraints.*;

/**
 * 定时任务日志表单
 * 2022/9/10
 *
 * @author LiJian
 */
@ApiModel(value = "定时任务日志表单")
public class UpmsQuartzJobLogDto {
    @ApiModelProperty(value = "任务名称", required = true)
    @NotEmpty(message = "任务名称" + TipConstants.NOT_EMPTY)
    @Length(min = 1, max = 50)
    private String jobName;

    @ApiModelProperty(value = "任务类名", required = true)
    @NotEmpty(message = "任务类名" + TipConstants.NOT_EMPTY)
    @Length(min = 1, max = 100)
    private String jobClass;

    @ApiModelProperty(value = "任务方法", required = true)
    @NotEmpty(message = "任务方法" + TipConstants.NOT_EMPTY)
    @Length(min = 1, max = 100)
    private String jobMethod;

    @ApiModelProperty(value = "任务参数", required = true)
    @Length(min = 1, max = 300)
    private String jobParam;

    @ApiModelProperty(value = "目标类", required = true)
    @NotEmpty(message = "目标类" + TipConstants.NOT_EMPTY)
    @Length(min = 1, max = 200)
    private String invokeTarget;

    @ApiModelProperty(value = "操作时间", required = true)
    @NotNull(message = "操作时间" + TipConstants.NOT_EMPTY)
    private Long startTime;

    @ApiModelProperty(value = "消耗时长", required = true)
    @NotNull(message = "消耗时长" + TipConstants.NOT_EMPTY)
    private Integer spendTime;

    @ApiModelProperty(value = "日志信息", required = true)
    @NotEmpty(message = "日志信息" + TipConstants.NOT_EMPTY)
    @Length(min = 1, max = 500)
    private String jobMessage;

    @ApiModelProperty(value = "执行状态（0正常 1失败）", required = true)
    @NotNull(message = "执行状态" + TipConstants.NOT_EMPTY)
    @Min(value = 0)
    @Max(value = 1)
    private Byte status;

    @ApiModelProperty(value = "异常信息")
    private String exceptionInfo;

    public String getJobName() {
        return jobName;
    }

    public void setJobName(String jobName) {
        this.jobName = jobName;
    }

    public String getJobClass() {
        return jobClass;
    }

    public void setJobClass(String jobClass) {
        this.jobClass = jobClass;
    }

    public String getJobMethod() {
        return jobMethod;
    }

    public void setJobMethod(String jobMethod) {
        this.jobMethod = jobMethod;
    }

    public String getJobParam() {
        return jobParam;
    }

    public void setJobParam(String jobParam) {
        this.jobParam = jobParam;
    }

    public String getInvokeTarget() {
        return invokeTarget;
    }

    public void setInvokeTarget(String invokeTarget) {
        this.invokeTarget = invokeTarget;
    }

    public Long getStartTime() {
        return startTime;
    }

    public void setStartTime(Long startTime) {
        this.startTime = startTime;
    }

    public Integer getSpendTime() {
        return spendTime;
    }

    public void setSpendTime(Integer spendTime) {
        this.spendTime = spendTime;
    }

    public String getJobMessage() {
        return jobMessage;
    }

    public void setJobMessage(String jobMessage) {
        this.jobMessage = jobMessage;
    }

    public Byte getStatus() {
        return status;
    }

    public void setStatus(Byte status) {
        this.status = status;
    }

    public String getExceptionInfo() {
        return exceptionInfo;
    }

    public void setExceptionInfo(String exceptionInfo) {
        this.exceptionInfo = exceptionInfo;
    }
}